package com.xl.singletonPattern;

public class Logger {

    private static class LoggerHolder {
        private static final Logger INSTANCE = new Logger();
    }

    private Logger() {
        System.out.println("创建实例...");
    }

    public static Logger getInstance() {
        return LoggerHolder.INSTANCE;
    }

    public void info(String message) {
        System.out.println("INFO: " + message);
    }

    public void error(String message) {
        System.out.println("ERROR: " + message);
    }
}
